package com.cedric.yixianpai.server.Utils;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class GameInfoDTO {
    @JsonProperty("p1Info")
    private PlayerInfoDTO p1InfoDTO;
    @JsonProperty("p2Info")
    private PlayerInfoDTO p2InfoDTO;
    private List<CardVo> p1Cards;
    private List<CardVo> p2Cards;


    public GameInfoDTO(GameInfoDTO rawInfo, List<CardVo> p1newCards) {
        this.p1InfoDTO=new PlayerInfoDTO(rawInfo.getP1InfoDTO().getName(), rawInfo.getP1InfoDTO().getHp(), rawInfo.getP1InfoDTO().getLvl());
        this.p2InfoDTO=new PlayerInfoDTO(rawInfo.getP2InfoDTO().getName(),rawInfo.getP2InfoDTO().getHp(), rawInfo.getP2InfoDTO().getLvl());
        this.p1Cards = p1newCards;
        this.p2Cards = rawInfo.getP2Cards();
    }
}
